/**
 * 员工信息列表视图
 */
Ext.define("app.view.staff.List",{
	extend:'Ext.grid.Panel',
	alias:'widget.stafflist',
	store:'StaffStore',
	width:1000,
	height:600,
	border:0,
	selModel:{
		selType:'checkboxmodel'//选择模式， 复选框模式
	},
	
	multiSelect:true,//允许多选
	frame:true,// 圆角边框
	enableKeyNav:true,//键盘方向
	columnLines:true,//竖线

	dockedItems:[
				{//顶部工具栏
				    xtype: 'toolbar',
				    dock: 'top',
				    
				    items: [			     
				          {xtype:'button',text:'添加',action:'add'},//按钮
						  {xtype:'button',text:'删除',action:'delete'},
						  {xtype:'button',text:'修改密码',action:'updatePwd'},
					      {xtype:'button',text:'下载模板',action:'download'},
					      {xtype:'button',text:'导入信息',action:'import'},
					      ]
				},
	             {//自定义工具栏
			      xtype:'pagingtoolbar',//分页工具栏
			      store:'StaffStore',//引用的store
			      //pageSize:2,
			      dock:'bottom',//位置在底部
			      displayInfo:true//显示信息
	             }
	 ],  
	columns:[//表格列字段
	         //layout:'fit',
	   {text:'姓名',dataIndex:'name',width:100}, 
	   {text:'英文名',dataIndex:'ename',width:100}, 
	   {
		   text:'性别',dataIndex:'sex',width:100,
		   renderer:function (value){
		        if (value === 1) {
		            return '男';
		        }
		        return '女';
		  } 
	   },
	   {text:'年龄',dataIndex:'age',width:100},
	   {text:'地址',dataIndex:'address',width:100},
	   {text:'部门',dataIndex:'department',width:100,editor: 'textfield',renderer:function(v,e){ return e.record.data.deptname;}},
	   {
		   text:'生日',dataIndex:'birthday',width:100,renderer:function(v){ return Ext.util.Format.date(v, 'Y-m-d');}
	   },
	   {text:'工号',dataIndex:'sid',width:100},
	   {text:'电话',dataIndex:'tel',width:100}, 
	   {text:'邮箱',dataIndex:'email',width:100},
	   {text:'户籍',dataIndex:'area',width:100},
	   {text:'入职时间',dataIndex:'stime',width:100,renderer:function(v){ return Ext.util.Format.date(v, 'Y-m-d');}},
	   {text:'离职时间',dataIndex:'etime',width:100,renderer:function(v){ return Ext.util.Format.date(v, 'Y-m-d');}},
	   {text:'职位',dataIndex:'position',width:100},
	   {text:'转正时间',dataIndex:'rtime',width:100,renderer:function(v){ return Ext.util.Format.date(v, 'Y-m-d');}},
	 ],
	 

	initComponent:function(){//初始化方法
		this.callParent(arguments);
		
	}
});